package com.xgure.mapper;

import com.xgure.annotation.Autofill;
import com.xgure.dto.ShopUpdateDTO;
import com.xgure.enumerator.AutofillEnum;
import com.xgure.pojo.Shop;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface ShopMapper {

    /**
     * 添加新的店铺
     *
     */
    @Autofill(AutofillEnum.INSERT)
    void add(Shop shop);

    /**
     * 根据id获取店铺信息
     *
     */
    @Select("select * from shop where id = #{shopId}")
    Shop getById(@Param("shopId") Long shopId);

    /**
     * 更新店铺信息
     *
     */
    @Autofill(AutofillEnum.UPDATE)
    void update(ShopUpdateDTO shopUpdateDTO);
}
